package org.goodsence.therevolt.listener;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.goodsence.framework.kafka.TopicName;
import org.goodsence.framework.rabbitmq.QueueName;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * @author zty
 * @apiNote
 * @project_name the-revolt
 * @user tain
 * @create_at 2023/6/16 2:25
 * @create_vio IntelliJ IDEA
 */
@Component
public class MQListener {

    @RabbitListener(queues = QueueName.TEST)
    public void rabbitMQReceive(String message){
        System.out.println(message);
    }

    @KafkaListener(topics = TopicName.TEST)
    public void kafkaReceive(ConsumerRecord<String, Object> record) {
        System.out.println(record);
    }
}
